cmake_minimum_required( VERSION 2.8 )

# This is so the FindLibSigCXX2.cmake file can be found
set( CMAKE_MODULE_PATH . )

#include_directories(${KORE2ENGINE_SOURCE_DIR}/src)
#link_directories(${KORE2ENGINE_BINARY_DIR}/src)

#the one C file
#add_executable(cdemo cdemo.c)
#target_link_libraries(cdemo m) #link the math library

#these are all compiled the same way
#set(PROGRAMS oglfirst pointers)
#set(CORELIBS ${SDL_LIBRARY} ${OPENGL_LIBRARY} m)

#foreach(program ${PROGRAMS})
#  add_executable(${program} ${program}.cpp)
#  target_link_libraries(${program} ${CORELIBS})
#endforeach(program)

#building just a library. 
#add_library(geometry geometry.cpp)

#add_executable(test_geometry test_geometry.cpp)
#linking against a custom library
#target_link_libraries(test_geometry ${CORELIBS} geometry)

Project ( Kore2 )

set (
   KORE2_SOURCES
   actors.cpp  camera.cpp  configfile.cpp  context.cpp  kore2.cpp  resource.cpp  scenes.cpp  sound.cpp
   sdl/compositor.cpp sdl/sdlcontext.cpp sdl/surface.cpp
   ui/font.cpp ui/menu.cpp ui/surface.cpp ui/window.cpp
)

# REQUIRED does not work in CMake <=2.4.6 for SDL
Find_Package ( SDL REQUIRED )
Find_Package ( SDL_image REQUIRED )
find_package ( LibSigCXX2 REQUIRED )
if( NOT LIBSIGCXX2_FOUND )
   message( SEND_ERROR "Failed to find the required package 'libsigc++'" )
endif( NOT LIBSIGCXX2_FOUND )

include_directories( ${LIBSIGCXX2_INCLUDE_DIRS} )
# target_link_libraries( main ${LIBSIGCXX2_LIBRARIES} )

link_libraries (
   ${SDL_LIBRARY}
   ${SDLIMAGE_LIBRARY}
   ${ZLIB_LIBRARY}
   ${LIBSIGC++_LIBRARIES}
   SDLmain
)

#add_executable ( ExecutableName ${SOURCES} )
add_library( kore2 STATIC ${KORE2_SOURCES} )



